<!DOCTYPE html>
<html>
<head>
	<title> Hello World </title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
	<?php
	include 'InicijalizatorSustava.php';

	$inicijalizator = new InicijalizatorSustava();
	$inicijalizator -> inicijaliziraj();

	$servername = "localhost";
	$username = "root";
	$password = "";
	$dbName = "bazaMinistarstava";

	$conn = new mysqli($servername, $username, $password, $dbName);
	if ($conn->connect_error) {
		die("Connection failed: " . $conn->connect_error);
	}

	$result = $conn->query("select * from ministarstvo");
	if ($result->num_rows > 0) {
    // output data of each row
		while($row = $result->fetch_assoc()) {
			echo "Naziv ministarstva: " . $row["nazivMinistarstva"] . "</br>";
			echo "Adresa ministarstva: " . $row["adrMinistarstva"] . "</br>";
			echo "Telefon ministarstva: " . $row["telMinistarstva"] . "</br>";
			echo "Email ministarstva: " . $row["emailMinistarstva"] . "</br>";
			echo "Povijest ministarstva: " . $row["povMinistarstva"] . "</br>";
		}
	} else {
		echo "0 results";
	}
	$conn->close();
	?>
</body>
</html>